package Operations;

import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class Add implements Ioperation{
    @Override
    public void work(BookList bookList) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入书名：");
        String name = scanner.nextLine();
        System.out.println("请输入作者：");
        String author = scanner.nextLine();
        System.out.println("请输入售价：");
        int prize = scanner.nextInt();
        scanner.nextLine();
        System.out.println("请输入类型：");
        String type = scanner.nextLine();
        bookList.books[bookList.Size++] = new Book(name,author,prize,type);
        System.out.println("添加书籍成功！");
    }
}
